import java.util.Enumeration;
import java.util.Vector;

/**
 * 组合设计模式
 * @author：涂有
 * @date 2017年7月3日 上午9:59:31
 */
public class TreeNode {

	private String name;
	private TreeNode parent;
	private Vector<TreeNode> children = new Vector<>();
	
	public TreeNode(String name) {
		super();
		this.name = name;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public TreeNode getParent() {
		return parent;
	}
	public void setParent(TreeNode parent) {
		this.parent = parent;
	}
	
	public void add(TreeNode node){
		children.add(node);
	}
	public void remove(TreeNode node){
		children.remove(node);
	}
	public Enumeration<TreeNode> getChildren(){
		return children.elements();
	}
}
